#include "mainwindow.h"
#include "ui_mainwindow.h"
#include<QFontDialog>

MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);
}

MainWindow::~MainWindow()
{
    delete ui;
}


void MainWindow::on_pushButton_clicked()
{
    bool ok = false;
    QFont font = QFontDialog::getFont(&ok);
    //该函数第一个参数是bool ok，意思是判断在字体设置窗口中用户选择的是ok还是cancel
    ui->pushButton->setFont(font);

}
